package com.cssy.yd.logic.dao.impl;

import com.cssy.yd.logic.dao.LogicMesWareDAO;
import com.cssy.yd.logic.entity.LogicMesWareDO;
import com.plat.helper.SearchConditions;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

/**
 * ��ݷ��ʶ���ʵ����
 * @since 2013-08-28
 */
public class LogicMesWareDAOImpl extends SqlMapClientDaoSupport implements LogicMesWareDAO {

    /**
     * �������
     * @param logicMesWareDO
     * @return ������ݵ�����
     */
    public String insertLogicMesWareDO(LogicMesWareDO logicMesWareDO) {
        Object id = getSqlMapClientTemplate().insert("LogicMesWare.insert", logicMesWareDO);
        return (String) id;
    }

    /**
     * ͳ�Ƽ�¼��
     * @param logicMesWareDO
     * @return ����ļ�¼��
     */
    public Integer countLogicMesWareDOByExample(LogicMesWareDO logicMesWareDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicMesWare.countByDOExample", logicMesWareDO);
        return count;
    }

    /**
     * ���¼�¼
     * @param logicMesWareDO
     * @return ��Ӱ�������
     */
    public Integer updateLogicMesWareDO(LogicMesWareDO logicMesWareDO) {
        int result = getSqlMapClientTemplate().update("LogicMesWare.update", logicMesWareDO);
        return result;
    }

    /**
     * ��ȡ�����б�
     * @param logicMesWareDO
     * @return �����б�
     */
    @SuppressWarnings("unchecked")
    public List<LogicMesWareDO> findListByExample(LogicMesWareDO logicMesWareDO) {
        List<LogicMesWareDO> list = getSqlMapClientTemplate().queryForList("LogicMesWare.findListByDO", logicMesWareDO);
        return list;
    }

    /**
     * ��������ȡlogicMesWareDO
     * @param id
     * @return logicMesWareDO
     */
    public LogicMesWareDO findLogicMesWareDOByPrimaryKey(String id) {
        LogicMesWareDO logicMesWareDO = (LogicMesWareDO) getSqlMapClientTemplate().queryForObject("LogicMesWare.findByPrimaryKey", id);
        return logicMesWareDO;
    }

    /**
     * ɾ���¼
     * @param id
     * @return ��Ӱ�������
     */
    public Integer deleteLogicMesWareDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicMesWare.deleteByPrimaryKey", id);
        return rows;
    }

	@Override
	public List<LogicMesWareDO> find(SearchConditions scs)
			throws DataAccessException {
   		List<LogicMesWareDO> list = getSqlMapClientTemplate().queryForList("LogicMesWare_ex.find", scs);
   		return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicMesWare_ex.count", scs);
	     return count;
	}

}